import java.util.List;

public class Test {
    public static void main(String[] args) {
        BinaryTree binaryTree=new BinaryTree();//创建二叉树
        BinaryTree.TreeNode root=binaryTree.createTree();//创建根节点
        System.out.println("==============");
        binaryTree.preOrder(root);
        System.out.println();
        List <BinaryTree.TreeNode> ret=binaryTree.preOrder2(root);
        for(BinaryTree.TreeNode x:ret){
            System.out.print(x.val+" ");
        }
        System.out.println();

        binaryTree.inOrder(root);
        System.out.println();
        List <BinaryTree.TreeNode> ret1=binaryTree.inOrder2(root);
        for(BinaryTree.TreeNode x:ret1){
            System.out.print(x.val+" ");
        }
        System.out.println();

        binaryTree.postOrder(root);
        System.out.println();
        List <BinaryTree.TreeNode> ret3=binaryTree.postOrder2(root);
        for(BinaryTree.TreeNode x:ret3){
            System.out.print(x.val+" ");
        }
        System.out.println();
        binaryTree.nodeSize1(root);//计算节点个数
        binaryTree.preOrder2(root);//同上


    }


}
